﻿using System;
using FluentNHibernate.Mapping;
using Caramel.NHibernate.Membership.Entities;

namespace Caramel.NHibernate.Membership.Mapping
{
	public class aspnet_UsersMapping : ClassMap<aspnet_Users>
	{
		public aspnet_UsersMapping()
		{
			this.
				Table("aspnet_Users");

			this.
				Id(e => e.ID).
				Column("UserId").
				GeneratedBy.
				GuidComb();

			this.
				Map(e => e.UserName).
				Length(256).
				Not.
				Nullable();

			this.
				Map(e => e.LoweredUserName).
				Length(256).
				Not.
				Nullable();

			this.
				Map(e => e.MobileAlias).
				Length(16).
				Nullable();

			this.
				Map(e => e.IsAnonymous).
				Not.
				Nullable();

			this.
				Map(e => e.LastActivityDate).
				Not.
				Nullable();

			this.
				References(e => e.Application).
				Column("ApplicationId").
				Not.
				Nullable();
		}
	}
}
